Teaching is Tough

optional caption text

Teaching is Tough

"I feel a large part of music education is a disaster today. A lot of it's coming from people who don't know how to teach"

"There are still some great schools and sources of learning, and those people know exactly what I'm talking about"

Jeff Berlin - Considered by many to be the finest electric bass player in the world

He stresses the importance of fundamentals

Wild Claims !

Drawing

Wild Claims !

Drawing

Have to be able to play this

Before playing this

Wild Claims Part Deux ?

Drawing

Beware of Micro Specialization

  • R for Business Intelligence
  • Data Science for Epidemiologists
  • Data Science for Nursing Research
  • Intro to Statisics using R
  • Data Visualization for Biologists
  • Statistics for Clinicians
  • Machine Learning for City Planners
  • R for SAS Programmers

I Teach Two Classes

  1. BIOS 545 Introduction to R Programming
    • For BIOS students only (for the most part)
    • Ground up introduction to R
    • Fast-paced
    • Assumes some previous programming
    • Homework Assignments and Final
  2. INFO 550 Software Engineering
    • INFO students
    • Assumes previous programming
    • Encourages Exploration
    • Must learn new things rapdily
    • Project Oriented

Motivating Learning

Motivations for Learning ?

  • The course is required
  • It will be useful for later work
  • Someone advised me to take this class
  • I couldn't find a more interesting course to take

(Better) Motivations for Learning ?

  • Less reliance upon others
  • Enhanced productivity
  • Eliminate barriers to research
  • Exellent employment prospects

You Are Really Teaching Independence

Analysis vs Programming Tools

  • R,SAS, SPSS are analysis frameworks first and programming languages second
  • Python and Java are programming languages first with analysis addons
  • MATLAB is a hybrid

This doesn't include more specific tools

  • Weka
  • TensorFlow
  • KNIME
  • RapidMiner
  • Orange
  • Pandas

At Scale Tools (Increasingly Popular)

Reproducibility and Availability

Crisis

Drawing

Use Reproducible Research Tools

  • Sweave
  • knitr
  • Markdown
  • Jupyter

Use Git !!

  • Great for Backing Up Your Code
  • Can handle multiple versions
  • Can Share with others
  • Others can modify and submit changes
  • Issue Tracking
  • Contains a Wiki

Learning Analysis and Programming

Like Learning to Cook

  • Start with a good recipe
  • Demonstration (by a competent cook)
  • Observation (by students)
  • Duplication (basic repitition)
  • Imitation (repitition with changes)
  • Fear of Messing Things Up

Just Eat Frozen Food or Eat Out

  • Unhealthy
  • Little Variation
  • Expensive
  • No Self Sufficiency
  • No Independence

Creating Interesting Material

Think of an encompassing project

  • For advanced students give them the project all at once

  • For Intro classes cover each subtopic per week
    • Homeowork and Labs
    • Maybe a final project
  • For Intermediate classes do a combination
    • Have mid term and final projects
    • Some supporting homework

Yum !

optional caption text

Make the Pasta

Cut the Pasta

Dry the Pasta

Make the Sauce

Boil Pasta

Programming Assignment

You Gotta Break Things Up

Solving for \(\sqrt{S}\) is the same as solving \(f(x) = x^2 - S = 0\)

We can use Newton's Method to iterate towards an answer:

\[x_{n+1} = x_{n} - \frac{f(x)_n}{f'(x)_n} = x_n - \frac{x_{n}^2 - S}{2x_n} = \frac{1}{2}(x_n + \frac{S}{x_n})\] Make a first guess and then compute \(x_{n+1}\) until \(x_{n+1}^2\) is close enough to S within some specified tolerance

A Beginning Approach

Make a guess (e.g 2) of the square root of some number (e.g. 16)
Specify a tolerance level (e.g. 0.0001)

while the absolute value of the square of that guess minus 
      the number  is >= than tolerance
          compute a new guess
somenum <- 16
tolerance <- 0.0001
guess <- 2

# Note we have to use Absolute value since we 
# are concerned with the magnitude of the difference

while( abs((guess^2)-somenum) >= tolerance) {
  guess <- (guess + (somenum/guess)) * 0.5
}
guess

Segment the work into functions

somenum <- 16
tolerance <- 0.0001
guess <- 2

# Write a Function to judge quality of computed guess 

compare <- function(guess,target) {
   diff <- abs((guess^2)-target)  
   return(diff)
}

while(compare(guess,target) >= tolerance) {
  guess <- (guess + (target/guess)) * 0.5
}

guess

Create functions with sane arguments and defaults

mySqrt <- function(target=16,guess=2,tolerance=0.0001,verbose=FALSE) {
  while( abs((guess^2)-target) >= tolerance) {
    guess <- (guess + (target/guess)) * 0.5
    if (verbose) {
      print(guess)
    }
  }
  return(guess)
}

Functions that embed other functions

mySqrt <- function(target=16,guess=2,tolerance=0.0001,verbose=FALSE) {
  compare <- function(guess,target) {
   diff <- abs((guess^2)-target)  
   return(diff)
  }
  
  while(compare(guess,target) >= tolerance) {
    guess <- (guess + (target/guess)) * 0.5
    if (verbose) {
      print(guess)
    }
  }
  return(guess)
}
mySqrt(16,2,0.0001)

Vectorize the function

sapply(c(16,22,49,39),mySqrt)

# or

round(sapply(c(16,22,49,39),mySqrt),2)

# or

Sqrt <- function(input=c(16,22,49,39),rnd=2) {
  retvec <- round(sapply(input,mySqrt),rnd)
  return(retvec)
}

Now for the Dark Side

Another Crisis ?

Drawing

Academic Dishonesty

Academic Dishonesty

  • Lectures on Honor Code Are Helpful
  • Keeps the Honest Person Honest
  • It Can Still Happen
  • Google Is Easy To Use
  • Stack Overflow Knowingly Aids and Abets Cheating
  • Cheating is Easy to Spot

Academic Dishonesty

  • Competition
  • Start the assignment late
  • Later assignments rely on earlier work
  • Very easy to get help from others
  • Students circulate past assignments
  • Claims of language confusion

Academic Dishonesty

In 2011 this assignment was given in the "Paradigms for Computing'' class at Stanford

Academic Dishonesty

Within 1 day this was found on the Stack Overflow site: